<template>
  <view>
    地址新增/编辑
  </view>
</template>

<script>
export default {
  data() {
    return {
      isNew: true,//判断是新增还是编辑
      addressInfo: {},//具体信息
    }
  },
  onLoad(option) {
    this.isNew = option.mode === 'add'
    if (!this.isNew) {
      this._getAddrinfo(option.id)
    }
    console.log(
        option
    )
  },
  methods: {
    // 获取地址信息方便回显
    _getAddrinfo(id) {
      let params = {
        id: id
      }
      this.$api.getMssdUserAddrById(params).then(res => {
        if (res.success) {
          this.addressInfo = res.result
        }
      })
    }
  },
}
</script>

<style lang="scss" scoped>

</style>
